package com.ruoyi.system.service.impl;

import java.time.LocalDateTime;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RecommendedMapper;
import com.ruoyi.system.domain.Recommended;
import com.ruoyi.system.service.IRecommendedService;

/**
 * 为你推荐配置Service业务层处理
 * 
 * @author zhang
 * @date 2025-07-24
 */
@Service
public class RecommendedServiceImpl implements IRecommendedService 
{
    @Autowired
    private RecommendedMapper recommendedMapper;

    /**
     * 查询为你推荐配置
     * 
     * @param recommendedId 为你推荐配置主键
     * @return 为你推荐配置
     */
    @Override
    public Recommended selectRecommendedByRecommendedId(Long recommendedId)
    {
        return recommendedMapper.selectRecommendedByRecommendedId(recommendedId);
    }

    /**
     * 查询为你推荐配置列表
     * 
     * @param recommended 为你推荐配置
     * @return 为你推荐配置
     */
    @Override
    public List<Recommended> selectRecommendedList(Recommended recommended)
    {
        return recommendedMapper.selectRecommendedList(recommended);
    }

    /**
     * 新增为你推荐配置
     * 
     * @param recommended 为你推荐配置
     * @return 结果
     */
    @Override
    public int insertRecommended(Recommended recommended)
    {
        recommended.setRecommendedAddtime(LocalDateTime.now());
        return recommendedMapper.insertRecommended(recommended);
    }

    /**
     * 修改为你推荐配置
     * 
     * @param recommended 为你推荐配置
     * @return 结果
     */
    @Override
    public int updateRecommended(Recommended recommended)
    {
        return recommendedMapper.updateRecommended(recommended);
    }

    /**
     * 批量删除为你推荐配置
     * 
     * @param recommendedIds 需要删除的为你推荐配置主键
     * @return 结果
     */
    @Override
    public int deleteRecommendedByRecommendedIds(Long[] recommendedIds)
    {
        return recommendedMapper.deleteRecommendedByRecommendedIds(recommendedIds);
    }

    /**
     * 删除为你推荐配置信息
     * 
     * @param recommendedId 为你推荐配置主键
     * @return 结果
     */
    @Override
    public int deleteRecommendedByRecommendedId(Long recommendedId)
    {
        return recommendedMapper.deleteRecommendedByRecommendedId(recommendedId);
    }
}
